﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MVC.Web.UI.Tabs
{
    public class TabBuilder : NavigationItemTabBuilder
    {

        public TabBuilder(WebTabCollection<NavigationItem> collection, string prefix)
            :base(collection,prefix)
        { 
        }

        public override INavigationTabBuilder<NavigationItemTabBuilder> AjaxLoad(bool ajaxLoad)
        { 
           ((Tab)this.NavItem).IsAjaxLoad = ajaxLoad;
            return this;
        }

        public override INavigationTabBuilder<NavigationItemTabBuilder> Name(string name)
        {
            this.NavItem.Name = name;
            return this;
        }

        public override INavigationTabBuilder<NavigationItemTabBuilder> Content(Func<NavigationItemTabBuilder, System.Web.WebPages.HelperResult> content)
        {
            this.NavItem.Content = content(this);
            return this;
        }

        public override INavigationTabBuilder<NavigationItemTabBuilder> Url(string url)
        {
              this.NavItem.Url = url;
              return this;        
        }

        public override INavigationItem<NavigationItem> GetItem()
        {
          return  this.NavItem;
        }

      
    }
}
